IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SrvrInstncCfg2MSSQL]') AND type in (N'U'))
BEGIN
     DROP TABLE [dbo].[SrvrInstncCfg2MSSQL]
END
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SrvrInstncCfg2MSSQL](
     [SrvrInstncId]         [int]          NOT NULL,
     [PackageExecutionId]   [int]          NOT NULL,
     [StartDt]              [datetime]     NOT NULL,
     [EndDt]                [datetime]     NOT NULL,
     [CurrentRecordFlag]    [tinyint]      NOT NULL CONSTRAINT [DF_SrvrInstncCfg2MSSQL_CurrentRecordFlag] DEFAULT ((0)),
     [SysConfigurationId]   [int]          NOT NULL,
     [SysConfigurationName] [varchar](255) NOT NULL,
     [ConfigValue]          [bigint]       NOT NULL,
     [RunValue]             [bigint]       NOT NULL,
     CONSTRAINT [PK_SrvrInstncCfg2MSSQL] PRIMARY KEY CLUSTERED ( [SrvrInstncId] ASC, [StartDt] ASC, [SysConfigurationId] ASC ) 
)
GO

SET ANSI_PADDING OFF
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular Database Server Instance.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL', @level2type=N'COLUMN',@level2name=N'SrvrInstncId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Execution Id of the package that populated or updated this row (usually by SSIS).' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL', @level2type=N'COLUMN',@level2name=N'PackageExecutionId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Effective start date of this record.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL', @level2type=N'COLUMN',@level2name=N'StartDt'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Effective end date of this record.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL', @level2type=N'COLUMN',@level2name=N'EndDt'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Flag indicating that this record is the current record.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL', @level2type=N'COLUMN',@level2name=N'CurrentRecordFlag'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Server instance configuration data for MSSQL Servers.  Contains effective dated list of server instance configuration data for a MSSQL type server.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncCfg2MSSQL'
GO
